package com.lu.manage.modular.system.model;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @program LuBoot
 * @description: 系统用户表
 * @author: showlu
 * @create: 2019-10-17 09:11:00
 */
@Data
@Accessors(chain = true)
@TableName("sys_user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    //主键id
    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    private String id;
    //头像
    @TableField("avatar")
    private String avatar;
    //账号
    @TableField("account")
    private String account;
    //密码
    @TableField("password")
    private String password;
    //md5密码盐
    @TableField("salt")
    private String salt;
    //名字
    @TableField("name")
    private String name;
    //生日
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField("birthday")
    private Date birthday;
    //性别(字典)
    @TableField("sex")
    private Integer sex;
    //电子邮件
    @TableField("email")
    private String email;
    //电话
    @TableField("phone")
    private String phone;
    //角色id(多个逗号隔开)
    @TableField("role_id")
    private String roleId;
    //部门id(多个逗号隔开)
    @TableField("dept_id")
    private String deptId;
    //状态(字典)
    @TableField("status")
    private Integer status;
    //更新时间
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    //更新人
    @TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    @TableField(exist = false)
    private String deptName;
    @TableField(exist = false)
    private String roleName;

}
